package ss.cc.tt;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Created by Admin on 12/26 0026.
 */
@WebServlet(name = "ShoppingServlet2",urlPatterns = "/shoppingServlet2")
public class ShoppingServlet2 extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String address=request.getParameter("address");
        String name=request.getParameter("name");
        String cardType=request.getParameter("cardType");
        String card=request.getParameter("card");

        Customer customer=new Customer(address,name,cardType,card);
        request.getSession().setAttribute("customer",customer);
        response.sendRedirect(request.getContextPath()+"/shoppingcart/confirm.jsp");

    }
}
